import*as t from"../../../core/platform/platform.js";const e=new Map;var r=Object.freeze({__proto__:null,filmStripFromTraceEngine:function(r,n){const s=[],o=void 0!==n?n:r.Meta.traceBounds.min,i=e.get(r)?.get(o);if(i)return i;for(const t of r.Screenshots){if(t.ts<o)continue;const e={index:s.length,screenshotEvent:t,screenshotAsString:t.args.snapshot};s.push(e)}const a={frames:Array.from(s)};return t.MapUtilities.getWithDefault(e,r,(()=>new Map)).set(o,a),a},frameClosestToTimestamp:function(e,r){const n=t.ArrayUtilities.nearestIndexFromEnd(e.frames,(t=>t.screenshotEvent.ts<r));return null===n?null:e.frames[n]}});export{r as FilmStrip};
